require_relative 'boot'

# require 'rails/all'
require 'rails'

# Pick the frameworks you want:
require 'active_model/railtie'
require 'active_job/railtie'
require 'active_record/railtie'
require 'action_controller/railtie'
require 'action_mailer/railtie'
# require 'action_view/railtie'
require 'action_cable/engine'
# require 'sprockets/railtie'
require 'rails/test_unit/railtie'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module XhgyApi
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
    config.eager_load_paths += %W(#{config.root}/lib #{config.root}/app/uploaders #{config.root}/app/policies)
    config.api_only = true
    config.active_record.default_timezone = :local
    config.time_zone = 'Beijing'
    # config.i18n.default_locale = :zh
    config.encoding = 'utf-8'

    config.generators do |generator|
      generator.helper false
      generator.assets false
      generator.view_specs false
      generator.test_framework false
      generator.skip_routes true # 同时跳过路由的自动设置
    end
  end
end
